Ignore key translations only at top-level
authorjustbur <justin@burkett.cc>
Wed, 18 Nov 2015 15:49:23 +0000 (10:49 -0500)
committerjustbur <justin@burkett.cc>
Wed, 18 Nov 2015 15:52:59 +0000 (10:52 -0500)
C-x 8 is a valid place to put translations for example

which-key.el

index 75bd580d87dbfd01683dee2950901e0f7dad369d..7dea2c32139e029a03c4a314cec7e31c647dd3dd 100644 (file)
@@ -1232,7 +1232,8 @@ alists. Returns a list (key separator description)."
   (let ((key-str-qt (regexp-quote (key-description which-key--current-prefix)))
         (buffer (current-buffer))
         (ignore-bindings '("self-insert-command" "ignore" "ignore-event" "company-ignore"))
-        (ignore-keys-regexp "mouse-\\|wheel-\\|remap\\|drag-\\|scroll-bar\\|select-window\\|switch-frame"))
+        (ignore-keys-regexp "mouse-\\|wheel-\\|remap\\|drag-\\|scroll-bar\\|select-window\\|switch-frame")
+        (ignore-sections-regexp "\\(Key translations\\|Function key map translations\\|Input decoding map translations\\)"))
     (with-temp-buffer
       (let ((indent-tabs-mode t))
         (describe-buffer-bindings buffer which-key--current-prefix))
@@ -1254,7 +1255,8 @@ alists. Returns a list (key separator description)."
            ((looking-at "^[ \t]*$")
             ;; ignore
             )
-           ((not (string-match-p "translations:" header))
+           ((or (not (string-match-p ignore-sections-regexp header))
+                which-key--current-prefix)
             (let ((binding-start (save-excursion
                                    (and (re-search-forward "\t+" nil t)
                                         (match-end 0))))